package com.matt.foundation.vo.course;

import lombok.Data;

import java.util.Date;


/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2018/1/24
 * *******************************
 */
@Data
public class CourseOfficialPageVo {
    private String id;
    private String name;
    private String typeName;
    private String modifyStaffName;
    private Long lastModified;
    private int status = 0;
    private String targetObject;
    private int beginMonth=0;
    private int endMonth=0;
    private String videoUrl;

    public static CourseOfficialPageVo of(Object[] objects) {
        CourseOfficialPageVo vo = new CourseOfficialPageVo();
        vo.setId(objects[0].toString());
        vo.setName(objects[1] == null ? "" : objects[1].toString());
        vo.setTypeName(objects[2] == null ? "" : objects[2].toString());
        vo.setLastModified(objects[3] == null ? 0L : ((Date) objects[3]).getTime());
        vo.setStatus(objects[4] == null ? 0 : Integer.valueOf(objects[4].toString()));
        vo.setModifyStaffName(objects[5] == null ? "" : objects[5].toString());
        vo.setTargetObject(objects[6] == null ? "" : objects[6].toString());
        vo.setBeginMonth(objects[7] == null ? 0 : Integer.valueOf(objects[7].toString()));
        vo.setEndMonth(objects[8] == null ? 0 : Integer.valueOf(objects[8].toString()));
        vo.setVideoUrl(objects[9] == null ? "" : objects[9].toString());
        return vo;
    }
}
